package com.gf.pokemon.constants;

import com.gf.pokemon.platform.exception.PokeErrorCode;
import com.gf.pokemon.platform.exception.PokeException;

public enum Vmode {
	single(0),
	multi(1);
	
	private Integer type;
	
	private Vmode(Integer type){
		this.type = type;
	}
	
	public Integer getType(){
		return type;
	}
	
	public static Vmode parse(Integer type) throws PokeException{
		for(Vmode mode:Vmode.values()){
			if(mode.getType().equals(type)){
				return mode;
			}
		}
		throw new PokeException(PokeErrorCode.INVALID_PARAM,"错误的选项类型，仅支持单选0和多选1");
	}
}
